﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpModelInterface.h"
#include "IDbObject.h"

struct RegenDataId;
namespace gcmp {
    
    class IGraphicsElementShape;
    class IElement;

    /// \brief 元素图形定制化行为接口类
    ///
    /// 需要定制化元素图形时，需要从此类派生，然后把Behaivor加入IInstance构件对象中。
    /// 执行定制化图形逻辑是在BaseGraphicsElementShape或者JoinGraphicsElementShape（有连接关系时）之后，
    /// OpenGraphicsElementShape（有打洞关系时）或者CutGraphicsElementShape（有扣减关系时）之前。
    class GCMP_MODEL_INTERFACE_EXPORT IGraphicsElementShapeCustomizableBehavior : public IDbObject
    {
        DEFINE_CAST_DERIVED(gcmp::IGraphicsElementShapeCustomizableBehavior, gcmp::IDbObject);
    public:
        virtual bool SetOwnerElement(IElement* pOwnerElement) = 0;

        /// \brief 报告关联更新计算所需要的RegenDataId
        /// \param oInputDatas 关联更新计算所需要的RegenDataId
        /// \return void
        virtual void ReportInputDataIds(std::vector<RegenDataId>& oInputDatas) const = 0;

        /// \brief 计算定制化图形
        /// 
        ///  平台在计算GraphicsElementShape时自动调用，为系统调用函数
        /// \param opGRep 输入图形
        /// \return 定制化的图形
        virtual OwnerPtr<IGraphicsElementShape> Customize(OwnerPtr<IGraphicsElementShape> opGRep) const = 0;
    };
}// namespace gcmp


